if __name__ == '__main__':
      s =[1,2,2,3,3,4,5,5]
      s.append('')
      str=[]
      for i in range(len(s)-2):
           if s[i]==s[i+1]:
               str.append(s[i])
print(str)